% This is `hypht1.tex' as of Nov 1, 1995.
%
% Copyright (C) 1995 Bernd Raichle/DANTE e.V.; all rights reserved.
%
% This file contains additional hyphenation patterns including
% the character hyphen `-' to be used in conjunction with
%
%   * all fonts with font encoding T1 and
%   * all national hyphenation patterns.
%
% It enables the hyphenation of words containing explicit hyphens
% when using fonts with \hyphenchar\font <> `\- (e.g. DC fonts
% version 1.2 or newer).
%
% It is an experimental version for testing and includes all
% lowercase characters (including national characters) in T1
% encoded fonts.
% In 1990 at the TUG meeting at Cork, Ireland, the european TeX
% user groups agreed on a 256 character encoding supporting many
% european languages with latin writing.  LaTeX2e supports this
% character encoding as font encoding "T1".
%
%
% The additional patterns add about 1600 patterns and 4 trie ops.
% Example: TeX reports for "hyphen.tex"
%    Hyphenation trie of length 6075 has 181 ops out of ...
% with the additional patterns it will report
%    Hyphenation trie of length 7664 has 185 ops out of ...
%
%
% Note:
%    The \hyphenation command gives special interpretation to the
%    character `-'.  Therefore it is not possible to include a
%    word with an explicit hyphen as hyphenation exception!
%
%
% Error reports in case of UNCHANGED versions to
%
%          Bernd Raichle
%          Stettener Str. 73
%          D-73732 Esslingen, FRG
%   Email: raichle@Informatik.Uni-Stuttgart.DE
%
% or 
%          DANTE e.V., Koordinator `german.sty'
%          Postfach 10 18 40
%          D-69008 Heidelberg, FRG
%   Email: german@Dante.DE
%
%
% Installation:
% =============
%
% 1. Make sure that the hyphenation trie of your TeX version has
%    enough room to load more hyphenation patterns (cf. "pattern
%    memory", "trie size" in the documentation of your
%    implementation).
%
% 2. load "hypht1.tex" in addition to _every_ hyphenation
%    patterns file (i.e. for every value of \language) you are
%    using; make sure that \language has not been changed.
%
%    Example for LaTeX2e:
%    To load US English and German hyphenation patterns, and load
%    "hypht1.tex" in addition to both sets of patterns, create a
%    file "hyphen.cfg" with the following contents:
%
%       \chardef\l@USenglish=0 \language=\l@USenglish
%       \input hyphen
%       \input hypht1
%
%       \newlanguage\l@german \language=\l@german
%       \input ghyph31
%       \input hypht1
%
%       \language=\l@USenglish
%       \lefthyphenmin=2 \righthyphenmin=3
%       \endinput
%
% 3. Use IniTeX to create a new format file.
%
%
% -----------------------------------------------------------------
%
\begingroup\expandafter\expandafter\expandafter
\endgroup\expandafter\ifx\csname ProvidesFile\endcsname\relax
  \wlog{File: hypht1.tex 1995/11/01 v.01 %
        Additional Hyphenation Patterns for T1-encoded fonts}
\else
  \ProvidesFile{hypht1.tex}%
     [1995/11/01 v0.1 Additional Hyphenation Patterns %
                      for T1-encoded fonts]
\fi
%
%
% It is possible to use T1-encoded font with TeX 2.x and
% include a subset '000-'177 of these additional hyphenation
% patterns.  Nonetheless TeX 2.x is unable to process more than
% one \patterns.  If you want to use these patterns, you have to
% include some changes below and in the used set of patterns.
% (You can contact the author for more information.)
%
\ifnum`\A=`\^^41 % TeX 2 or TeX 3?
\else
  \message{Sorry, you need TeX 3.x to use these patterns.}
  \expandafter\endinput
\fi
%
%
% Make hyphen `-' a word constituent:
%
\lccode`\-=`\-
%
%
% \patterns has a global effect, therefore we can open a group,
% make local changes, call \patterns{...}, close the group, and
% all changes are gone.
%
\begingroup
%
% Some feedback for users with slow computers:
%
\message{...please be patient...}
%
%
\toksdef\L=0 \L={}%  list of two letter patterns
\toksdef\S=2 \S={}%  list of "simple" patterns
%
\countdef\C=2  % use \C as temporary register for _c_har code
\countdef\i=0  % temporary registers: loop index i,j
%
\catcode`\Y=11 \lccode`\Y=0   % we need `Y' for special purposes
\catcode`\X=11 \lccode`\X=0   % dto for `X'
%
%
% 1) trvial cases:
%
\S={%
  2-1    % disallow hyphenation before, allow after hyphen
  .-2    % disallow hyphenation for cases like "bergauf und -ab"
}
%
%
% 2a) for all lowercase letters:
%     change catcode to letter (or other) to make sure that these
%            characters are not active, ignored, etc. and
%     change lccode to a non-zero value to allow its use inside
%            \patterns
%
% 2b) Add the patterns
%         .X-2    % disallow "X-|ray", "n-|fach", etc.
%         8X8Y-   % => "\righthyphenmin"=3 and "\lefthyphenmin"=3
%         -X8Y    %    before and after the hyphen
%     for all X,Y in the set of lowercase letters.
%
%
\def\a#1{%     add pattern to pattern list \L
  \C=#1\relax \catcode\C=11\lccode\C=\C
  \lccode`X=\C
  \lowercase{%
    \S\expandafter{\the\S .X-2 }%
    \L\expandafter{\the\L 8X8Y- -X8Y8 }%
  }}
%
%  
\def\y{%
  %
  % Add patterns for "lowercase letter d with bar"
  %
  \a{'236}%  lowercase letter d with bar
  %
  % ... and for all lowercase characters:
  %
  % for i=`z downto `a do
  %  change catcode & lccode of char with code i
  %  add patterns for this char
  % endfor
  %
  \i=`\z \advance\i 1 %
  %
  \def\x{%
    \ifnum\i>`\a %
      \advance\i -1 %
      \a\i            % add patterns for char `i'
      \expandafter\x
    \fi}%
  \x
  %
  % for i = char "ij" downto char "a breve" do
  %  change catcode & lccode of char with code i
  %  add patterns for this char
  % endfor
  %
  \i='275  % = '274 + 1   '274: lowercase letter ij
  %
  \def\x{%
    \ifnum\i>'240 %
      \advance\i -1 %
      \a\i            % add patterns for char `i'
      \expandafter\x
    \fi}%
  \x
  %
}% -- end of \y --
%
% Now do the real work:
%
\y
%
%
% The list of "simple" patterns is ready to use:
%
\patterns{ \the\S }%
\S={}% free memory used for token list
%
%
% Now \L contains all needed patterns for all characters X
% and one character Y.  To finish our task we have to loop over Y
% for all lowercase characters.
%
\def\h#1\relax{% lowercase #1 and add patterns
  \lowercase{%
    \patterns{#1}%
  }}
%
\def\a#1{%     add patterns in \L wth Y replaced by #1
  \lccode`Y=#1\relax
  \expandafter\h\the\L\relax
}
%
% Now do the real work (with the redefined macro \a):
%
\y
%
\message{done.}
%
% Restore all \catcode and \lccode setting, definitions for
% csname, register changes, etc.
%
\endgroup
\endinput
%% 
%% End of file `hypht1.tex'.
